<?php

namespace app\common\model;
use think\Model;

class Account extends Model
{
    protected $autoWriteTimestamp = true;
    
    protected $type = [
        'repayment_time'  =>  'timestamp:Y-m-d',
        'actual_time' =>  'timestamp:Y-m-d'
    ];
    
    public function agency()
    {
        return $this->hasOne('Agency','id','agency_id')->field('id,name');
    }
    
    public function user()
    {
        return $this->hasOne('User','id','user_id');
    }
    
    public function accountList(){
        return $this->hasMany('AccountList','account_id','id');
    }
    
  
}
